import request from '/@/utils/request';

// 查询水电列表
export function listMeter(query?: Object) {
  return request({
    url: '/module/devices/meter/list',
    method: 'get',
    params: query
  })
}

// 重置二维码
export function resetQrCodeMeter(data?: Object) {
  return request({
    url: '/module/devices/meter/resetQrCode',
    method: 'post',
    data
  })
}


// 电表清零
export function cleanMeter(data?: Object) {
  return request({
    url: '/module/devices/meter/clean',
    method: 'post',
    data
  })
}

// 电表开户
export function openAccountMeter(data?: Object) {
  return request({
    url: '/module/devices/meter/openAccount',
    method: 'post',
    data
  })
}

// 电表开户
export function rechargeMeter(data?: Object) {
  return request({
    url: '/module/devices/meter/recharge',
    method: 'post',
    data
  })
}



// 电表余额抄表
export function queryDataMeter(data?: Object) {
  return request({
    url: '/module/devices/meter/queryData',
    method: 'post',
    data
  })
}


// 查询水电详细
export function getMeter(id?: number) {
  return request({
    url: '/module/devices/meter/' + id,
    method: 'get'
  })
}

// 新增水电
export function addMeter(data?: Object) {
  return request({
    url: '/module/devices/meter',
    method: 'post',
    data
  })
}

// 修改水电
export function updateMeter(data?: Object) {
  return request({
    url: '/module/devices/meter',
    method: 'put',
    data
  })
}

// 删除水电
export function delMeter(id?: number) {
  return request({
    url: '/module/devices/meter/' + id,
    method: 'delete'
  })
}

// 导出水电
export function exportMeter(query?: Object) {
  return request({
    url: '/module/devices/meter/export',
    method: 'get',
    params: query
  })
}
